#include<stdio.h>
#include<math.h>
int main(void)
{
	int denominator,flag;
	double esp,item,sum;
	scanf("%lf",&esp);
	flag=1,denominator=1,sum=0,item=1.0; 
	do{
		item=flag*1.0/denominator;
		sum=sum+item;
		flag=-flag;
		denominator=denominator+3;
		}while(fabs(item)>esp);
	printf("sum = %.6f\n", sum);
	
	return 0;
 } 
